﻿using System.Linq;
using System.Erp.Runtime.Composition;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace System.Erp.Runtime.Test
{
    /// <summary>
    ///这是 TypeCatalogTest 的测试类，旨在
    ///包含所有 TypeCatalogTest 单元测试
    ///</summary>
    [TestClass()]
    public class TypeCatalogTest
    {
        /// <summary>
        ///TypeCatalog 的测试
        ///</summary>
        [TestMethod()]
        public void TypeCatalogConstructorTest()
        {
            Type type = typeof(SaveService);
            TypeCatalog target = new TypeCatalog(type);
            var haveit = (from p in target.GetResult()
                         where p.GetType() == typeof(ServicePart)
                         select p).Count();
            Assert.AreEqual<int>(1,haveit);
        }
    }
}
